{
  LW ComRing -- LightWave Communications Ring

  This unit contains declarations necessary to engage in a
  communications ring among plug-ins

  Based on lwcomring.h which is:
  Copyright 2003, NewTek, Inc.
}

{
  Copyright 2012, Jameel Halabi

  This unit is part of the BlaiseWave wrapper,
  which is licensed under the BSD 2-Clause license (see licenses/license.txt).
}


unit LW_ComRing;

{$mode objfpc}{$H+}

interface

uses
  LW_Types;

const
  LWCOMRING_GLOBAL       = 'LW Communication Ring' ;
  LW_PLUGIN_LIMBO_STATES = 'LW Plugin Limbo States';

  LW_LIMBO_START = $00000001;
  LW_LIMBO_END   = $00000002;

  // Color space events.

  LW_PORT_COLORSPACE = 'color-space-change';

  LWCSEV_CHANGE = 0;
  LWCSEV_SIZEOF = 1;

  {
    For applications with multiple non-modal windows, it is often useful for
    the host and the client windows to be able to broadcast state information
    pertinent to those windows.

    If the window data is NULL, then open or close your window.
    If the window data is not NULL, then the data is the name of the window that was opened or closed.
  }

  LW_PORT_WINSTATE = 'window-state';

  LWWSEV_CLOSE  = 0; // Close window.
  LWWSEV_OPEN   = 1; // Open  window.
  LWWSEV_SIZEOF = 2;

type
  TRingEvent = procedure
               (      ClientData : Pointer;
                      PortData   : Pointer;
                const EventCode  : Integer;
                const EventData  : Pointer) ;

  PLWComRing = ^TLWComRing;
  TLWComRing = record
    RingAttach  : function
                  (      Topic         : PChar      ;
                         PIData        : PLWInstance;
                         EventCallback : TRingEvent ) : Integer;
    RingDetach  : procedure
                  (      Topic         : PChar      ;
                         PIData        : PLWInstance) ;
    RingMessage : procedure
                  (      Topic         : PChar      ;
                         EventCode     : Integer    ;
                         EventData     : Pointer    ) ;
  end;

implementation

end.

